#include <iostream>
using std::cout;
using std::endl;


class Product
{
public:
    virtual ~Product() {};
    virtual void show() = 0;
};

class Product_1
    : public Product
{
public:
    virtual void show() override { cout << "Product_1" << endl;}
    virtual ~Product_1() override {}
};

class Product_2
    : public Product
{
public:
    virtual void show() override { cout << "Product_2" << endl;}
    virtual ~Product_2() override {}
};


class Factory
{
public:
    virtual ~Factory() {};
    virtual void create_product(Product* product) = 0;
};

class Factory_1
    : public Factory
{
public:
    virtual void create_product(Product* product) override { product->show();}
    virtual ~Factory_1() override {}
};

class Factory_2
    : public Factory
{
public:
    void create_product(Product* product) override { product->show();}
    virtual ~Factory_2() override {}
};


int main()
{
    Factory* fac1 = new Factory_1();
    fac1->create_product(new Product_1());

    Factory* fac2 = new Factory_2();
    fac2->create_product(new Product_2());

    return 0;
}